<template>
  <view class="search-container" :style="{'background-color':bgcolor}" @click="searchClick">
      <view class="search-box" :style="{'border-radius' : radius + 'px'}">
        <uni-icons type="search" size="20"></uni-icons>
        <text class="placeholder">搜索</text>
      </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    //外界指定背景颜色和圆角
    props:{
      bgcolor:{
        type:String,
        default:"#C00000"
      },
      radius:{
        type:Number,
        default:18
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      searchClick(){
        uni.navigateTo({
          url:'/subpkg/search/search',
        })
      }
    }
  }
</script>

<style lang="scss">
.search-container{
  height:50px;
  display: flex;
  align-items: center;
  padding:0 10px;
  
  .search-box{
    height:36px;
    width:100%;
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    
    .placeholder{
      font-size:15px;
      margin-left:3px;
    }
  }
}
</style>
